using System;
using System.Collections.Generic;
using System.Linq;
using Granite.ComponentModel;
using Granite.Testing;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Granite.Commons.Tests
{
    public class DictionaryChangedAssert : EventAssert<DictionaryChangedEventArgs>
    {
        readonly INotifyDictionaryChanged m_Source;

        public DictionaryChangedAssert(INotifyDictionaryChanged source)
            : base(source)
        {
            m_Source = source;
            m_Source.DictionaryChanged += SourceEventFired;
        }

        public EventPair<DictionaryChangedEventArgs> Expect(NotifyDictionaryChangedAction action)
        {
            //TODO: This needs to check the other fields on the event
			var nextEvent = Expect();
            Assert.AreEqual(action, nextEvent.EventArgs.Action, "The wrong action was set.");
            return nextEvent;
        }

    }

    //public class DictionaryChangedAssert<TKey, TValue> : EventAssert<DictionaryChangedEventArgs<TKey, TValue>>
    //{
    //    readonly INotifyDictionaryChanged<TKey, TValue> m_Source;

    //    public DictionaryChangedAssert(INotifyDictionaryChanged<TKey, TValue> source)
    //        : base(source)
    //    {
    //        m_Source = source;
    //        m_Source.DictionaryChanged += Source_EventFired;
    //    }

    //    public EventPair<DictionaryChangedEventArgs<TKey, TValue>> Expect(NotifyDictionaryChangedAction action)
    //    {
    //        //TODO: This needs to check the other fields on the event
    //        var nextEvent = GetNextEvent();
    //        Assert.AreEqual(action, nextEvent.EventArgs.Action, "The wrong action was set.");
    //        return nextEvent;
    //    }

    //}
}